class Admin::ItemsController < Admin::BaseController
  def index
    @cats = ItemCategory.cat1.to_json(ItemCategory::ALL_OUTPUT_HASH)
    #@items = Item.valid_items.admin_search(params).paginate :page => params[:page],:per_page => ADMIN_PER_PAGE
    @items = Item.admin_search(params, params[:page], ADMIN_PER_PAGE)
    @params = return_params
  end

  
  private
  def return_params
    {:item_id => params[:item_id],
      :item_title => params[:item_title],
      :brand => params[:brand],      
      :cat1_id => params[:cat1_id],
      :cat2_id => params[:cat2_id],
      :cat3_id => params[:cat3_id],
      :sort => params[:sort]
    }
  end
end
